﻿using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PanoramaTestApp.PcInfoServiceReference;

namespace PanoramaTestApp
{
    public class ItemViewModel : INotifyPropertyChanged
    {
        private string _fileName;
        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string FileName
        {
            get
            {
                return _fileName;
            }
            set
            {
                if (value != _fileName)
                {
                    _fileName = value;
                    NotifyPropertyChanged("FileName");
                }
            }
        }

        private string _creationTime;
        private bool _isChecked;

        /// <summary>
        /// Sample ViewModel property; this property is used in the view to display its value using a Binding.
        /// </summary>
        /// <returns></returns>
        public string CreationTime
        {
            get
            {
                return _creationTime;
            }
            set
            {
                if (value != _creationTime)
                {
                    _creationTime = value;
                    NotifyPropertyChanged("CreationTime");
                }
            }
        }

        public FileEntry FileEntryCache { get; set; }

        public bool IsChecked
        {
            get { return _isChecked; }
            set 
            { 
                _isChecked = value; 
                NotifyPropertyChanged("ÏsChecked");
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}